package com.woniuxy.utils;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author: ideaAdmin
 * TODO:全局异常处理器
 * Date: 2022/2/11:20:33
 * Description:
 */
@ControllerAdvice//控制器建议
public class GlobalExceptionHandler {

    @ExceptionHandler //异常处理器
    @ResponseBody
    public String handlerException(Exception exception, Model model){
        System.out.println(exception.getMessage());
        return "服务器正在维护";
    }
}
